<%@ Control Language="C#" AutoEventWireup="true" Codebehind="TablesProperty.ascx.cs"
    Inherits="Framework.Portal.Administrator.Database.TablesProperty" %>
<div>
    <asp:UpdatePanel ID="upanelGridUserManagemt" runat="server" UpdateMode="Conditional"
        RenderMode="Inline">
        <ContentTemplate>
            <asp:Literal ID="ltlJavascriptDataType" runat="server"></asp:Literal>
            <div>
                <div id="pageTopBar">
                    <asp:Label ID="lbldropTables" runat="server" Text="Drop Table"></asp:Label>
                    <asp:DropDownList ID="dropTables" runat="server" AutoPostBack="True" OnSelectedIndexChanged="dropTables_SelectedIndexChanged">
                    </asp:DropDownList>
                </div>
                <br />
                <asp:HyperLink ID="lnkTablesList" Text="Table List"
                    runat="server"></asp:HyperLink>
                &nbsp;|&nbsp;
                <asp:HyperLink ID="lnkTableDrop" Text="Table Drop"
                    runat="server"></asp:HyperLink>
                &nbsp;|&nbsp;
                <asp:HyperLink ID="lnkTableRename" Text="Table Name"
                    runat="server"></asp:HyperLink>
                <br />
                <br />
                <asp:Label ID="lblError" runat="server" Visible="false" SkinID="error"></asp:Label>
                <br />
                <asp:Button ID="btnCommit" runat="server" OnClick="btnCommit_Click" Text="Commit" /><br />
                <br />
                <asp:Panel ID="pnlColumns" runat="server" GroupingText="Columns">
                    <asp:GridView ID="gridColumns" runat="server" AutoGenerateColumns="False" OnRowDeleting="gridColumns_RowDeleting"
                        OnRowEditing="gridColumns_RowEditing">
                        <Columns>
                            <asp:BoundField HeaderText="Name"
                                DataField="name" HtmlEncode="False"></asp:BoundField>
                            <asp:BoundField HeaderText="DataType"
                                DataField="datatype" HtmlEncode="False"></asp:BoundField>
                            <asp:BoundField HeaderText="Width"
                                DataField="width" SortExpression="width" HtmlEncode="False"></asp:BoundField>
                            <asp:BoundField HeaderText="Scale"
                                DataField="scale" SortExpression="scale" HtmlEncode="False"></asp:BoundField>
                            <asp:BoundField HeaderText="Identity"
                                HtmlEncode="False" DataField="identity" SortExpression="identity"></asp:BoundField>
                            <asp:BoundField HeaderText="Seed"
                                HtmlEncode="False" DataField="seed" SortExpression="seed"></asp:BoundField>
                            <asp:BoundField HeaderText="Increment"
                                HtmlEncode="False" DataField="increment" SortExpression="increment"></asp:BoundField>
                            <asp:BoundField HeaderText="Default"
                                HtmlEncode="False" DataField="default" SortExpression="default"></asp:BoundField>
                            <asp:BoundField HeaderText="Default binding"
                                HtmlEncode="False" DataField="defaultbinding" SortExpression="defaultbinding"></asp:BoundField>
                            <asp:BoundField HeaderText="Constraint"
                                DataField="defaultConstraint" SortExpression="defaultConstraint" HtmlEncode="False">
                                <HeaderStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Rule binding"
                                DataField="ruleBinding" SortExpression="ruleBinding" HtmlEncode="False">
                                <HeaderStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Null"
                                DataField="isnull" SortExpression="isnull"></asp:BoundField>
                            <asp:CommandField ShowEditButton="True" EditText="Edit">
                            </asp:CommandField>
                            <asp:CommandField ShowDeleteButton="True" DeleteText="Drop">
                            </asp:CommandField>
                        </Columns>
                    </asp:GridView>
                </asp:Panel>
                <br />
                <asp:Panel ID="pnlEdit" runat="server" GroupingText="Edit">
                    <table border="0" cellspacing="1" cellpadding="1">
                        <tr>
                            <td>
                                <asp:Label ID="lblTxtColumnName" runat="server" Text="Column Name"></asp:Label></td>
                            <td colspan="5">
                                <asp:TextBox ID="txtColumnName" runat="server" Columns="40"></asp:TextBox>
                                &nbsp; &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblDropDataType" runat="server" Text="Data Type"></asp:Label></td>
                            <td>
                                <asp:DropDownList ID="dropDataType" runat="server">
                                </asp:DropDownList></td>
                            <td>
                                <asp:Label ID="lblTxtWidth" runat="server" Text="Width"></asp:Label></td>
                            <td>
                                <asp:TextBox ID="txtWidth" runat="server" Columns="10"></asp:TextBox></td>
                            <td>
                                <asp:Label ID="lblTxtScale" runat="server" Text="Scale"></asp:Label></td>
                            <td>
                                <asp:TextBox ID="txtScale" runat="server" Columns="10"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblRadioNull" runat="server" Text="Null"></asp:Label></td>
                            <td colspan="5">
                                <asp:RadioButtonList ID="radioNull" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                                    <asp:ListItem Value="true" Selected="True" Text="True"></asp:ListItem>
                                    <asp:ListItem Value="false" Text="False"></asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:CheckBox ID="checkIdentity" runat="server" Text="Identity"
                                    AutoPostBack="True" OnCheckedChanged="checkIdentity_CheckedChanged" /></td>
                            <td>
                                &nbsp;</td>
                            <td>
                                <asp:Label ID="lblTxtSeed" runat="server" Text="Seed"></asp:Label></td>
                            <td>
                                <asp:TextBox ID="txtSeed" runat="server" Columns="10" Enabled="False">1</asp:TextBox></td>
                            <td>
                                <asp:Label ID="lblTxtIncrement" runat="server" Text="Increment"></asp:Label></td>
                            <td>
                                <asp:TextBox ID="txtIncrement" runat="server" Columns="10" Enabled="False">1</asp:TextBox></td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblTxtDefault" runat="server" Text="Default"></asp:Label></td>
                            <td colspan="5">
                                <asp:TextBox ID="txtDefault" runat="server" Columns="10"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblDropDefaults" runat="server" Text="Defaults"></asp:Label>
                            </td>
                            <td colspan="5">
                                <asp:DropDownList ID="dropDefaults" runat="server">
                                </asp:DropDownList>
                                <asp:HiddenField ID="txtDefaultConstraint" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblDropRules" runat="server" Text="Rules"></asp:Label>
                            </td>
                            <td colspan="5">
                                <asp:DropDownList ID="dropRules" runat="server">
                                </asp:DropDownList>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <asp:Button ID="btnAdd" runat="server" OnClick="Button1_Click" Text="Add" />
                    <asp:Button ID="btnUpdate" runat="server" OnClick="btnUpdate_Click" Text="Update"
                        Visible="False" />
                    <asp:HiddenField ID="hideRowUpdate" runat="server" />
                </asp:Panel>
                <br />
                <asp:Panel ID="pnlConstraints" runat="server" GroupingText="Constraints">
                    <br />
                    <asp:HyperLink ID="lnkNewPK" Text="New primary key" runat="server"></asp:HyperLink>
                    &nbsp;|&nbsp;
                    <asp:HyperLink ID="lnkNewUK" Text="New unique key" runat="server"></asp:HyperLink>
                    &nbsp;|&nbsp;
                    <asp:HyperLink ID="lnkNewCC" Text="New check constraint key" runat="server"></asp:HyperLink>
                    &nbsp;|&nbsp;
                    <asp:HyperLink ID="lnkNewFK" Text="New foreign key" runat="server"></asp:HyperLink>
                    <br />
                    <br />
                    <div id="dependenciesTable">
                        <asp:TreeView ID="treeConstraints" runat="server" SkinID="treeMenuDependencies">
                            <Nodes>
                                <asp:TreeNode Text="PK"
                                    Value="PK" Expanded="True" SelectAction="None"></asp:TreeNode>
                                <asp:TreeNode Text="UK"
                                    Value="UK" Expanded="True" SelectAction="None"></asp:TreeNode>
                                <asp:TreeNode Text="CC"
                                    Value="CC" Expanded="True" SelectAction="None"></asp:TreeNode>
                                <asp:TreeNode Text="FK"
                                    Value="FK" Expanded="True" SelectAction="None"></asp:TreeNode>
                            </Nodes>
                        </asp:TreeView>
                    </div>
                </asp:Panel>
                <br />
                <asp:Panel ID="pnlDependencies" runat="server" GroupingText="Dependencies">
                    <div id="Div1">
                        <asp:TreeView ID="treeDependencies" runat="server" SkinID="treeMenuDependencies">
                            <Nodes>
                                <asp:TreeNode Text="Ref"
                                    Value="Ref" SelectAction="Expand">
                                    <asp:TreeNode Text="FN"
                                        Value="FN" SelectAction="Expand"></asp:TreeNode>
                                    <asp:TreeNode Text="I"
                                        Value="I" SelectAction="Expand"></asp:TreeNode>
                                    <asp:TreeNode Text="P"
                                        Value="P" SelectAction="Expand"></asp:TreeNode>
                                    <asp:TreeNode Text="U"
                                        Value="U" SelectAction="Expand"></asp:TreeNode>
                                    <asp:TreeNode Text="TR"
                                        Value="TR" SelectAction="Expand"></asp:TreeNode>
                                    <asp:TreeNode Text="V"
                                        Value="V" SelectAction="Expand"></asp:TreeNode>
                                </asp:TreeNode>
                                <asp:TreeNode Text="Dep"
                                    Value="Dep" SelectAction="Expand">
                                    <asp:TreeNode Text="U"
                                        Value="U" SelectAction="Expand"></asp:TreeNode>
                                    <asp:TreeNode Text="D"
                                        Value="D" SelectAction="Expand"></asp:TreeNode>
                                </asp:TreeNode>
                            </Nodes>
                        </asp:TreeView>
                    </div>
                </asp:Panel>
            </div>
            <asp:Literal ID="ltlExecuteJavascript" runat="server"></asp:Literal>
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
